/*
 *  $Id: ArrayLocalizer.cs 1176 2010-11-08 11:19:45Z thenn.erannor $
 *	This file is a part of Ragima CCG.
 *	(C) 2008-2010 Ragima development group.
 *
 *	Licensed under the terms of the GNU GPL License version 2.
 *
 */

namespace Ragima.Languages {
    /// <summary>
    /// Локализатор ресурсов, принимающий массив пар идентификатор/ресурс.
    /// </summary>
    public class ArrayLocalizer: DefaultLocalizer {
        public ArrayLocalizer(string langCode, ResourceItem[] resources): this(langCode, string.Empty, resources) {}
        public ArrayLocalizer(string langCode, string prefix, ResourceItem[] resources): base(langCode, prefix) {
            foreach (var item in resources)
                AddResource(item.Id, item.Resource);
        }
        public ArrayLocalizer(string langCode, ResourceGroup[] groups): this(langCode, string.Empty, groups) {}
        public ArrayLocalizer(string langCode, string prefix, ResourceGroup[] groups): base(langCode, prefix) {
            foreach (var group in groups)
                foreach (var item in group.Resources)
                    AddResource(group.Prefix+item.Id, item.Resource);
        }
    }
}
